package com.ruoyi.limitCoupon.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.limitCoupon.mapper.LimitCouponConfigMapper;
import com.ruoyi.limitCoupon.domain.LimitCouponConfig;
import com.ruoyi.limitCoupon.service.ILimitCouponConfigService;

/**
 * 限时卡券Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class LimitCouponConfigServiceImpl implements ILimitCouponConfigService 
{
    @Autowired
    private LimitCouponConfigMapper limitCouponConfigMapper;

    /**
     * 查询限时卡券
     * 
     * @param id 限时卡券主键
     * @return 限时卡券
     */
    @Override
    public LimitCouponConfig selectLimitCouponConfigById(Long id)
    {
        return limitCouponConfigMapper.selectLimitCouponConfigById(id);
    }

    /**
     * 查询限时卡券列表
     * 
     * @param limitCouponConfig 限时卡券
     * @return 限时卡券
     */
    @Override
    public List<LimitCouponConfig> selectLimitCouponConfigList(LimitCouponConfig limitCouponConfig)
    {
        return limitCouponConfigMapper.selectLimitCouponConfigList(limitCouponConfig);
    }

    /**
     * 新增限时卡券
     * 
     * @param limitCouponConfig 限时卡券
     * @return 结果
     */
    @Override
    public int insertLimitCouponConfig(LimitCouponConfig limitCouponConfig)
    {
        limitCouponConfig.setCreateTime(DateUtils.getNowDate());
        return limitCouponConfigMapper.insertLimitCouponConfig(limitCouponConfig);
    }

    /**
     * 修改限时卡券
     * 
     * @param limitCouponConfig 限时卡券
     * @return 结果
     */
    @Override
    public int updateLimitCouponConfig(LimitCouponConfig limitCouponConfig)
    {
        limitCouponConfig.setUpdateTime(DateUtils.getNowDate());
        return limitCouponConfigMapper.updateLimitCouponConfig(limitCouponConfig);
    }

    /**
     * 批量删除限时卡券
     * 
     * @param ids 需要删除的限时卡券主键
     * @return 结果
     */
    @Override
    public int deleteLimitCouponConfigByIds(Long[] ids)
    {
        return limitCouponConfigMapper.deleteLimitCouponConfigByIds(ids);
    }

    /**
     * 删除限时卡券信息
     * 
     * @param id 限时卡券主键
     * @return 结果
     */
    @Override
    public int deleteLimitCouponConfigById(Long id)
    {
        return limitCouponConfigMapper.deleteLimitCouponConfigById(id);
    }
}
